#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
    if(argc != 4)
    {
        printf("usage: calculate (-add or -sub or -mul or -div) x y\n");
    }
    else 
    {
        int a = atoi(argv[2]);
        int b = atoi(argv[3]);
        if(strcmp(argv[1], "-add") == 0)
            printf("%d+%d=%d\n", a, b, a+b);
        else if(strcmp(argv[1], "-sub") == 0)
            printf("%d-%d=%d\n", a, b, a-b);
        else if(strcmp(argv[1], "-mul") == 0)
            printf("%d*%d=%d\n", a, b, a*b);
        else if(strcmp(argv[1], "-div") == 0)
            printf("%d/%d=%d\n", a, b, a/b);
        else 
            printf("error\n");
    }
    return 0;
}
